package ro.k.web.beans;

public class KBeanUtils {
	public static int pageNr(Object obj) {
		String str;
		if (obj == null) {
			return 1;
		} else {
			str = obj.toString();
			if ((str.trim()).equals("null") || (str.trim()).equals("")) {
				return 1;
			}
		}
		try {
			return Integer.parseInt(str);
		} catch (Exception e) {
			return 1;
		}
	}
	
	public static boolean isEmpty(Object obj) {
		if (obj == null) {
			return true;
		} else {
			if (obj.toString().length() == 0) {
				return true;
			}
		}
		return false;
	}
}
